From d6705efef568a2ccb2d231c67effe741fea4c5a8 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Wed, 27 Jul 2022 09:15:03 +0000 Subject: [PATCH 1/7] =?UTF-8?q?=ED=8C=8C=ED=8A=B8=EB=84=88=20=EC=9D=BC?= =?UTF-8?q?=EC=9D=BC=ED=98=84=ED=99=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mock-api/apps/report/daily-partner/api.ts | 81 +- .../apps/report/daily-partner/data.ts | 1084 +++++++++-------- .../components/list.component.html | 556 ++++----- .../components/list.component.ts | 143 +-- .../daily-partner/models/daily-partner.ts | 61 +- .../resolvers/daily-partner.resolver.ts | 3 +- .../services/daily-partner.service.ts | 21 +- 7 files changed, 949 insertions(+), 1000 deletions(-) diff --git a/src/app/mock-api/apps/report/daily-partner/api.ts b/src/app/mock-api/apps/report/daily-partner/api.ts index 4981939..59556ec 100644 --- a/src/app/mock-api/apps/report/daily-partner/api.ts +++ b/src/app/mock-api/apps/report/daily-partner/api.ts @@ -33,12 +33,32 @@ export class ReportDailyPartnerMockApi { .reply(({ request }) => { // Get available queries const search = request.params.get('search'); - const sort = request.params.get('sort') || 'name'; + const sort = request.params.get('sort') || 'lastDayHoldingMoney'; const order = request.params.get('order') || 'asc'; + const page = parseInt(request.params.get('page') ?? '1', 10); + const size = parseInt(request.params.get('size') ?? '10', 10); // Clone the dailyPartners let dailyPartners: any[] | null = cloneDeep(this._dailyPartners); + // Sort the dailys + if ( + sort === 'lastDayHoldingMoney' || + sort === 'memberCharge' || + sort === 'memberExchange' + ) { + dailyPartners.sort((a, b) => { + const fieldA = a[sort].toString().toUpperCase(); + const fieldB = b[sort].toString().toUpperCase(); + return order === 'asc' + ? fieldA.localeCompare(fieldB) + : fieldB.localeCompare(fieldA); + }); + } else { + dailyPartners.sort((a, b) => + order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] + ); + } // If search exists... if (search) { // Filter the dailyPartners @@ -49,6 +69,41 @@ export class ReportDailyPartnerMockApi { ); } + // Paginate - Start + const dailysLength = dailyPartners.length; + + // Calculate pagination details + const begin = page * size; + const end = Math.min(size * (page + 1), dailysLength); + const lastPage = Math.max(Math.ceil(dailysLength / size), 1); + + // Prepare the pagination object + let pagination = {}; + + // If the requested page number is bigger than + // the last possible page number, return null for + // dailys but also send the last possible page so + // the app can navigate to there + if (page > lastPage) { + dailyPartners = null; + pagination = { + lastPage, + }; + } else { + // Paginate the results by size + dailyPartners = dailyPartners.slice(begin, end); + + // Prepare the pagination mock-api + pagination = { + length: dailysLength, + size: size, + page: page, + lastPage: lastPage, + startIndex: begin, + endIndex: end - 1, + }; + } + // Return the response return [ 200, @@ -61,21 +116,21 @@ export class ReportDailyPartnerMockApi { // ----------------------------------------------------------------------------------------------------- // @ DailyPartner - GET // ----------------------------------------------------------------------------------------------------- - // this._fuseMockApiService - // .onGet('api/apps/report/daily-partner') - // .reply(({ request }) => { - // // Get the id from the params - // const id = request.params.get('id'); + this._fuseMockApiService + .onGet('api/apps/report/daily-partner') + .reply(({ request }) => { + // Get the id from the params + const id = request.params.get('id'); - // // Clone the dailyPartners - // const dailyPartners = cloneDeep(this._dailyPartners); + // Clone the dailyPartners + const dailyPartners = cloneDeep(this._dailyPartners); - // // Find the dailyPartner - // const dailyPartner = dailyPartners.find((item: any) => item.id === id); + // Find the dailyPartner + const dailyPartner = dailyPartners.find((item: any) => item.id === id); - // // Return the response - // return [200, dailyPartner]; - // }); + // Return the response + return [200, dailyPartner]; + }); // ----------------------------------------------------------------------------------------------------- // @ DailyPartner - POST diff --git a/src/app/mock-api/apps/report/daily-partner/data.ts b/src/app/mock-api/apps/report/daily-partner/data.ts index 2fd6c65..f64a447 100644 --- a/src/app/mock-api/apps/report/daily-partner/data.ts +++ b/src/app/mock-api/apps/report/daily-partner/data.ts @@ -1,545 +1,551 @@ /* eslint-disable */ export const dailyPartners = [ + { + id: '8fcce528-d878-4cc8-99f7-bd3451ed5402', + processDate: '2022-06-20', + lastDayHoldingMoney: 22846133, + memberCharge: 0, + memberExchange: 0, + memberProfitLoss: 0, + partnerCharge: 0, + partnerExchange: 0, + partnerProfitLoss: 0, + totalProfitLoss: 0, + passiveMoney: 0, + passiveComp: 0, + casinoBetting: 0, + casinoTie: 0, + casinoCancel: 0, + casinoAvailable: 0, + casinoWinning: 0, + casinoWinLoss: 0, + casinoCommission: 0, + casinoBetWinCalculate: 0, + slotBetting: 160000, + slotCancel: 0, + slotAvailable: 160000, + slotWinning: 90280, + slotWinLoss: 69720, + slotCommission: 8000, + slotBetWinCalculate: 61720, + powerballBetting: 0, + powerballWinning: 0, + powerballWinLoss: 0, + powerballCommission: 0, + powerballBetWinCalculate: 0, + totalBetWinCalculate: 61720, + }, // { - // id: 'on00', - // totalPartnerCount: '5', - // totalHoldingMoney: 303675, - // totalComp: 108933, - // total: 412608, - // branchCount: 1, - // divisionCount: 1, - // officeCount: 1, - // storeCount: 1, - // memberCount: 1, - // nickname: 'on00', - // accountHolder: '11', - // phoneNumber: '010-1111-1111', - // calculateType: '롤링', - // ownCash: 50000, - // ownComp: 1711, - // ownCoupon: 50000, - // gameMoney: 0, - // todayComp: 0, - // totalDeposit: 0, - // totalWithdraw: 0, - // balance: 0, - // registDate: '2022-06-12 15:38', - // finalSigninDate: '', - // ip: '', - // state: '정상', - // note: '', + // user: { + // id: '1', + // signinId: 'kgon1', + // type: '본사', + // parentId: 0, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', + // }, + // { + // user: { + // id: '2', + // signinId: 'kgon2', + // type: '대본', + // parentId: 1, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', + // }, + // { + // user: { + // id: '3', + // signinId: 'kgon1', + // type: '본사', + // parentId: 2, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', + // }, + // { + // user: { + // id: '4', + // signinId: 'kgon1', + // type: '부본', + // parentId: 3, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', + // }, + // { + // user: { + // id: '5', + // signinId: 'kgon1', + // type: '본사', + // parentId: 0, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', + // }, + // { + // user: { + // id: '6', + // signinId: 'kgon1', + // type: '본사', + // parentId: 0, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', + // }, + // { + // user: { + // id: '7', + // signinId: 'kgon1', + // type: '본사', + // parentId: 0, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', + // }, + // { + // user: { + // id: '8', + // signinId: 'kgon1', + // type: '본사', + // parentId: 0, + // }, + // bank: { + // users: { + // deposit: '0', + // withdraw: '0', + // netProfit: 0, + // }, + // parthners: { + // deposit: '0', + // withdraw: '0', + // netProfit: '0', + // }, + // totalNetProfit: '0', + // passiveMoney: '0', + // passiveComp: '0', + // casino: { + // betting: '382,000', + // bettingTie: '33,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // slot: { + // betting: '382,000', + // bettingCancel: '0', + // bettingValid: '351,000', + // bettingWin: '357,050', + // winLoss: '26,950', + // commission: { + // total: '7,020', + // partner: '5,265', + // me: '1,755', + // }, + // betWinSettle: '19,930', + // }, + // powerball: { + // betting: '0', + // bettingCancel: '0', + // bettingValid: '0', + // bettingWin: '0', + // winLoss: '0', + // commission: { + // total: '0', + // partner: '0', + // me: '0', + // }, + // betWinSettle: '19,930', + // }, + // }, + // totalBetSettle: '119,400', // }, - { - user: { - id: '1', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '2', - signinId: 'kgon2', - type: '대본', - parentId: 1, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '3', - signinId: 'kgon1', - type: '본사', - parentId: 2, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '4', - signinId: 'kgon1', - type: '부본', - parentId: 3, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '5', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '6', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '7', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '8', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, ]; diff --git a/src/app/modules/admin/report/daily-partner/components/list.component.html b/src/app/modules/admin/report/daily-partner/components/list.component.html index 4e72342..6b300f4 100644 --- a/src/app/modules/admin/report/daily-partner/components/list.component.html +++ b/src/app/modules/admin/report/daily-partner/components/list.component.html @@ -1,348 +1,230 @@ -
-
-
-
- -
-
- 파트너일일현황 -
-
- +
+ +
+ +
+ +
+ +
파트너일일현황
+ +
+ + +
+
+ +
+ +
+ + + + 전체 + 파워볼 + 카지노 + 슬롯 + + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
-
- -
- - - - {{ - roleSelect.value | titlecase - }} - - - -
{{ role.label }}
-
-
-
-
+
+ +
+
+ +
+
+ +
+
+ + +
+ +
+ + +
+ +
+
요율
+
상부
+
+ 아이디 +
+ 닉네임 +
+ 연락처
- -
- - - - - +
+ 등급 +
+ 레벨
- -
- - - - - -
- -
-
- - - - -
+ + + + +
-
-
-
- + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
정보 - - {{ info?.user.signinId }} - - - {{ info?.user.type }} - - 매출보기 - +회원입출 - {{ info?.bank.users.deposit }} - {{ info?.bank.users.withdraw }} - {{ info?.bank.users.netProfit }} - 파트너입출 - {{ info?.bank.parthners.deposit }} - {{ info?.bank.parthners.withdraw }} - {{ info?.bank.parthners.netProfit }} - 총손익 - {{ info?.bank.totalNetProfit }} - 수동머니 - {{ info?.bank.passiveMoney }} - 수동콤프 - {{ info?.bank.passiveComp }} - 배팅 - {{ info?.bank.casino.betting }} - 당첨 - {{ info?.bank.casino.bettingWin }} - 윈로스(A) - {{ info?.bank.casino.winLoss }} - 수수료(B) - {{ info?.bank.casino.commission.total }} - 벳윈정산(A-B) - {{ info?.bank.casino.betWinSettle }} - 배팅 - {{ info?.bank.slot.betting }} - 당첨 - {{ info?.bank.slot.bettingWin }} - 윈로스(D) - {{ info?.bank.slot.winLoss }} - 수수료(E) - {{ info?.bank.slot.commission.total }} - 벳윈정산(A-B) - {{ info?.bank.slot.betWinSettle }} - 배팅 - {{ info?.bank.powerball.betting }} - 당첨 - {{ info?.bank.powerball.bettingWin }} - 윈로스(G) - {{ info?.bank.powerball.winLoss }} - 수수료(H) - {{ info?.bank.powerball.commission.total }} - 벳윈정산(G-H) - {{ info?.bank.powerball.betWinSettle }} - 총벳윈정산 - {{ info?.totalBetSettle }} - - Second group -
-
+
+
요율
+
+ {{ dailyPartner.highRank }} +
+
+ {{ dailyPartner.signinId }} +
+ {{ dailyPartner.nickname }} +
+ {{ dailyPartner.phoneNumber }} +
+
+ {{ dailyPartner.rank }} +
+ LV{{ dailyPartner.level }} +
+ + + + + +
+ +
+ + + + + + +
+ There are no data!
-
+
diff --git a/src/app/modules/admin/report/daily-partner/components/list.component.ts b/src/app/modules/admin/report/daily-partner/components/list.component.ts index aa499ab..f0c216e 100644 --- a/src/app/modules/admin/report/daily-partner/components/list.component.ts +++ b/src/app/modules/admin/report/daily-partner/components/list.component.ts @@ -14,7 +14,8 @@ import { FormGroup, Validators, } from '@angular/forms'; - +import { MatPaginator } from '@angular/material/paginator'; +import { MatSort } from '@angular/material/sort'; import { debounceTime, map, @@ -24,9 +25,6 @@ import { switchMap, takeUntil, } from 'rxjs'; - -import { MatTableDataSource } from '@angular/material/table'; - import { fuseAnimations } from '@fuse/animations'; import { FuseConfirmationService } from '@fuse/services/confirmation'; @@ -64,46 +62,20 @@ import { Router } from '@angular/router'; animations: fuseAnimations, }) export class ListComponent implements OnInit, AfterViewInit, OnDestroy { + @ViewChild(MatPaginator) private _paginator!: MatPaginator; + @ViewChild(MatSort) private _sort!: MatSort; + dailyPartners$!: Observable; users$!: Observable; + __isSearchOpened = false; isLoading = false; searchInputControl = new FormControl(); selectedDailyPartner?: DailyPartner; + pagination?: DailyPartnerPagination; - dailyParthnerForm!: FormGroup; - - dailyPartnerDataSource: MatTableDataSource = new MatTableDataSource(); - dailyPartnerTableColumns: string[] = [ - 'partnerInfo', - 'expansionBtn', - 'depositDetails', - 'depositPartnerDetails', - 'totalProfit', - 'passiveMoney', - 'passiveComp', - 'casinoBetDetails', - 'casinoWinningDetails', - 'casinoWinLoss', - 'casinoCommission', - 'casinoSettle', - 'slotBetDetails', - 'slotWinningDetails', - 'slotWinLoss', - 'slotCommission', - 'slotSettle', - 'powerballBetDetails', - 'powerballWinningDetails', - 'powerballWinLoss', - 'powerballCommission', - 'powerballSettle', - 'totalBetWinSettle', - ]; private _unsubscribeAll: Subject = new Subject(); - roles: any[]; - roles2: any[]; - /** * Constructor */ @@ -113,37 +85,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { private _formBuilder: FormBuilder, private _dailyPartnerService: DailyPartnerService, private router: Router - ) { - this.roles = [ - { - label: '전체', - value: '전체', - }, - { - label: '파워볼', - value: '파워볼', - }, - { - label: '카지노', - value: '카지노', - }, - - { - label: '슬롯', - value: '슬롯', - }, - ]; - this.roles2 = [ - { - label: '회원아이디', - value: '전체', - }, - { - label: '닉네임', - value: '파워볼', - }, - ]; - } + ) {} // ----------------------------------------------------------------------------------------------------- // @ Lifecycle hooks @@ -153,27 +95,63 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { * On init */ ngOnInit(): void { - this.dailyParthnerForm = this._formBuilder.group({ - bankName: [''], - accountNumber: [''], - accountHolder: [''], - }); // Get the pagination - this._dailyPartnerService - .getDailyPartners() + this._dailyPartnerService.pagination$ .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((dailyPartners: any) => { + .subscribe((pagination: DailyPartnerPagination | undefined) => { + // Update the pagination + this.pagination = pagination; + // Mark for check - this.dailyPartnerDataSource = dailyPartners.dailyPartners; - console.log(dailyPartners); this._changeDetectorRef.markForCheck(); }); + + // Get the products + this.dailyPartners$ = this._dailyPartnerService.dailyPartners$; } /** * After view init */ - ngAfterViewInit(): void {} + ngAfterViewInit(): void { + if (this._sort && this._paginator) { + // Set the initial sort + this._sort.sort({ + id: 'lastDayHoldingMoney', + start: 'asc', + disableClear: true, + }); + + // Mark for check + this._changeDetectorRef.markForCheck(); + + // If the daily changes the sort order... + this._sort.sortChange + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe(() => { + // Reset back to the first page + this._paginator.pageIndex = 0; + }); + + // Get products if sort or page changes + merge(this._sort.sortChange, this._paginator.page) + .pipe( + switchMap(() => { + this.isLoading = true; + return this._dailyPartnerService.getDailyPartners( + this._paginator.pageIndex, + this._paginator.pageSize, + this._sort.active, + this._sort.direction + ); + }), + map(() => { + this.isLoading = false; + }) + ) + .subscribe(); + } + } /** * On destroy @@ -208,6 +186,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { */ __toggleDetails(productId: string): void {} + /** + * toggle the search + * Used in 'bar' + */ + __onClickSearch(): void { + this.__isSearchOpened = !this.__isSearchOpened; + } + /** * Track by function for ngFor loops * @@ -217,7 +203,4 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { __trackByFn(index: number, item: any): any { return item.id || index; } - __testData(info: any): any { - console.log(info); - } } diff --git a/src/app/modules/admin/report/daily-partner/models/daily-partner.ts b/src/app/modules/admin/report/daily-partner/models/daily-partner.ts index 623b465..edf6229 100644 --- a/src/app/modules/admin/report/daily-partner/models/daily-partner.ts +++ b/src/app/modules/admin/report/daily-partner/models/daily-partner.ts @@ -1,29 +1,38 @@ export interface DailyPartner { - id?: string; - totalPartnerCount?: number; - totalHoldingMoney?: number; - totalComp?: number; - total?: number; - branchCount?: number; - divisionCount?: number; - officeCount?: number; - storeCount?: number; - memberCount?: number; + id: string; + signinId?: string; + rank?: string; nickname?: string; - accountHolder?: string; - phoneNumber?: string; - calculateType?: string; - ownCash?: number; - ownComp?: number; - ownCoupon?: number; - gameMoney?: number; - todayComp?: number; - totalDeposit?: number; - totalWithdraw?: number; - balance?: number; - registDate?: string; - finalSigninDate?: string; - ip?: string; - state?: string; - note?: string; + memberCharge?: number; // 회원충전 + memberExchange?: number; // 회원환전 + memberProfitLoss?: number; // 회원손익 + partnerCharge?: number; // 파트너충전 + partnerExchange?: number; // 파트너환전 + partnerProfitLoss?: number; // 파트너손익 + totalProfitLoss?: number; // 전체손익 + passiveMoney?: number; + passiveComp?: number; + casinoBetting?: number; // 카지노배팅 + casinoTie?: number; // 카지노타이 + casinoCancel?: number; // 카지노취소 + casinoAvailable?: number; // 카지노유효 + casinoWinning?: number; // 카지노당첨 + casinoWinLoss?: number; // 카지노윈로스(A) + casinoCommission?: number; // 카지노수수료(B) + casinoBetWinCalculate?: number; // 카지노벳윈정산 (A-B) + slotBetting?: number; // 슬롯배팅 + slotCancel?: number; // 슬롯취소 + slotAvailable?: number; // 슬롯유효 + slotWinning?: number; // 슬롯당첨 + slotWinLoss?: number; // 슬롯윈로스(D) + slotTotalCommission?: number; // 슬롯전체수수료(E) + slotBottomCommission?: number; // 슬롯하부수수료(E) + slotOwnCommission?: number; // 슬롯본인수수료(E) + slotBetWinCalculate?: number; // 슬롯벳윈정산(D-E) + powerballBetting?: number; // 파워볼배팅 + powerballWinning?: number; // 파워볼당첨 + powerballWinLoss?: number; // 파워볼윈로스(H) + powerballCommission?: number; // 파워볼수수료(I) + powerballBetWinCalculate?: number; // 파워볼벳윈정산(H-I) + totalBetWinCalculate?: number; // 총벳윈정산 } diff --git a/src/app/modules/admin/report/daily-partner/resolvers/daily-partner.resolver.ts b/src/app/modules/admin/report/daily-partner/resolvers/daily-partner.resolver.ts index f9ed4e7..dd62c7d 100644 --- a/src/app/modules/admin/report/daily-partner/resolvers/daily-partner.resolver.ts +++ b/src/app/modules/admin/report/daily-partner/resolvers/daily-partner.resolver.ts @@ -81,8 +81,9 @@ export class DailyPartnersResolver implements Resolve { route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): Observable<{ + pagination: DailyPartnerPagination; dailyPartners: DailyPartner[]; }> { - return this._dailyPartnerService.getDailyPartners(''); + return this._dailyPartnerService.getDailyPartners(); } } diff --git a/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts b/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts index 92cefa6..166837d 100644 --- a/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts +++ b/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts @@ -74,19 +74,32 @@ export class DailyPartnerService { * @param order * @param search */ - getDailyPartners(search: string = ''): Observable<{ - dailyPartners: any; + getDailyPartners( + page: number = 0, + size: number = 10, + sort: string = 'name', + order: 'asc' | 'desc' | '' = 'asc', + search: string = '' + ): Observable<{ + pagination: DailyPartnerPagination; + dailyPartners: DailyPartner[]; }> { return this._httpClient .get<{ - dailyPartners: any; - }>('api/apps/report/daily-partner', { + pagination: DailyPartnerPagination; + dailyPartners: DailyPartner[]; + }>('api/apps/report/daily-partner/daily-partners', { params: { + page: '' + page, + size: '' + size, + sort, + order, search, }, }) .pipe( tap((response) => { + this.__pagination.next(response.pagination); this.__dailyPartners.next(response.dailyPartners); }) ); From 571d6cea3a606347f1854c86abd705ea42fc8540 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Thu, 28 Jul 2022 01:16:25 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deposit/components/list.component.html | 40 ++++++------ .../withdraw/components/list.component.html | 60 +++++++++--------- .../components/list.component.html | 20 +++--- .../user/components/list.component.html | 61 +++++++++---------- 4 files changed, 90 insertions(+), 91 deletions(-) diff --git a/src/app/modules/admin/bank/deposit/components/list.component.html b/src/app/modules/admin/bank/deposit/components/list.component.html index 15d1aee..78d79a5 100644 --- a/src/app/modules/admin/bank/deposit/components/list.component.html +++ b/src/app/modules/admin/bank/deposit/components/list.component.html @@ -89,18 +89,18 @@
-
- -
-
- -
+
+ +
+
+ +
-
-
- -
-
- +
+ +
+
+ +
diff --git a/src/app/modules/admin/bank/withdraw/components/list.component.html b/src/app/modules/admin/bank/withdraw/components/list.component.html index aa31f9b..eb636fc 100644 --- a/src/app/modules/admin/bank/withdraw/components/list.component.html +++ b/src/app/modules/admin/bank/withdraw/components/list.component.html @@ -89,23 +89,23 @@
-
- -
-
- -
-
- -
+
+ +
+
+ +
+
+ +
-
-
- -
-
- -
-
- +
+ +
+
+ +
+
+ +
diff --git a/src/app/modules/admin/member/unconnected/components/list.component.html b/src/app/modules/admin/member/unconnected/components/list.component.html index 9e2db1f..204e4ad 100644 --- a/src/app/modules/admin/member/unconnected/components/list.component.html +++ b/src/app/modules/admin/member/unconnected/components/list.component.html @@ -276,15 +276,15 @@
-
-
- -
-
- +
+ +
+
+ +
diff --git a/src/app/modules/admin/member/user/components/list.component.html b/src/app/modules/admin/member/user/components/list.component.html index 4a18d18..e06f7e6 100644 --- a/src/app/modules/admin/member/user/components/list.component.html +++ b/src/app/modules/admin/member/user/components/list.component.html @@ -266,7 +266,6 @@
IP{{ user.ip }} - @@ -292,35 +291,35 @@ - -
- -
-
- -
-
- -
-
- -
-
- -
-
- +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
From 8dfd81dd114bfc840606a49e9551a730917d3f1b Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Thu, 28 Jul 2022 13:03:40 +0000 Subject: [PATCH 3/7] =?UTF-8?q?=EA=B8=88=EC=9D=BC=EB=B0=B0=ED=8C=85?= =?UTF-8?q?=EC=9E=90=EB=AA=A9=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mock-api/apps/report/daily-partner/api.ts | 2 +- src/app/mock-api/apps/report/today-bet/api.ts | 56 +- .../mock-api/apps/report/today-bet/data.ts | 548 +--------------- .../services/daily-partner.service.ts | 2 +- .../monthly/components/list.component.html | 4 +- .../today-bet/components/list.component.html | 618 +++++++++--------- .../today-bet/components/list.component.ts | 148 ++--- .../report/today-bet/models/today-bet.ts | 62 +- .../today-bet/services/today-bet.service.ts | 15 +- 9 files changed, 506 insertions(+), 949 deletions(-) diff --git a/src/app/mock-api/apps/report/daily-partner/api.ts b/src/app/mock-api/apps/report/daily-partner/api.ts index 59556ec..6c6d045 100644 --- a/src/app/mock-api/apps/report/daily-partner/api.ts +++ b/src/app/mock-api/apps/report/daily-partner/api.ts @@ -29,7 +29,7 @@ export class ReportDailyPartnerMockApi { // @ DailyPartners - GET // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onGet('api/apps/report/daily-partner', 300) + .onGet('api/apps/report/daily-partners', 300) .reply(({ request }) => { // Get available queries const search = request.params.get('search'); diff --git a/src/app/mock-api/apps/report/today-bet/api.ts b/src/app/mock-api/apps/report/today-bet/api.ts index 583a03f..722e1f6 100644 --- a/src/app/mock-api/apps/report/today-bet/api.ts +++ b/src/app/mock-api/apps/report/today-bet/api.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { assign, cloneDeep } from 'lodash-es'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; import { todayBets as todayBetsData } from './data'; -import { contacts } from '../../chat/data'; @Injectable({ providedIn: 'root', @@ -34,12 +33,29 @@ export class ReportTodayBetMockApi { .reply(({ request }) => { // Get available queries const search = request.params.get('search'); - const sort = request.params.get('sort') || 'name'; + const sort = request.params.get('sort') || 'signinId'; const order = request.params.get('order') || 'asc'; + const page = parseInt(request.params.get('page') ?? '1', 10); + const size = parseInt(request.params.get('size') ?? '10', 10); // Clone the todayBets let todayBets: any[] | null = cloneDeep(this._todayBets); + // Sort the todayBets + if (sort === 'signinId' || sort === 'nickname' || sort === 'rank') { + todayBets.sort((a, b) => { + const fieldA = a[sort].toString().toUpperCase(); + const fieldB = b[sort].toString().toUpperCase(); + return order === 'asc' + ? fieldA.localeCompare(fieldB) + : fieldB.localeCompare(fieldA); + }); + } else { + todayBets.sort((a, b) => + order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] + ); + } + // If search exists... if (search) { // Filter the todayBets @@ -50,11 +66,47 @@ export class ReportTodayBetMockApi { ); } + // Paginate - Start + const todayBetsLength = todayBets.length; + + // Calculate pagination details + const begin = page * size; + const end = Math.min(size * (page + 1), todayBetsLength); + const lastPage = Math.max(Math.ceil(todayBetsLength / size), 1); + + // Prepare the pagination object + let pagination = {}; + + // If the requested page number is bigger than + // the last possible page number, return null for + // todayBets but also send the last possible page so + // the app can navigate to there + if (page > lastPage) { + todayBets = null; + pagination = { + lastPage, + }; + } else { + // Paginate the results by size + todayBets = todayBets.slice(begin, end); + + // Prepare the pagination mock-api + pagination = { + length: todayBetsLength, + size: size, + page: page, + lastPage: lastPage, + startIndex: begin, + endIndex: end - 1, + }; + } + // Return the response return [ 200, { todayBets, + pagination, }, ]; }); diff --git a/src/app/mock-api/apps/report/today-bet/data.ts b/src/app/mock-api/apps/report/today-bet/data.ts index d998fcd..caeba1f 100644 --- a/src/app/mock-api/apps/report/today-bet/data.ts +++ b/src/app/mock-api/apps/report/today-bet/data.ts @@ -2,518 +2,40 @@ export const todayBets = [ { - user: { - id: '1', - signinId: 'kgon1', - type: '본사', - parentId: 0, - rank: '회원', - level: '4', - nickname: 'aa100', - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '2', - signinId: 'kgon2', - type: '대본', - parentId: 1, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '3', - signinId: 'kgon1', - type: '본사', - parentId: 2, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '4', - signinId: 'kgon1', - type: '부본', - parentId: 3, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '5', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '6', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '7', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', - }, - { - user: { - id: '8', - signinId: 'kgon1', - type: '본사', - parentId: 0, - }, - bank: { - users: { - deposit: '0', - withdraw: '0', - netProfit: 0, - }, - parthners: { - deposit: '0', - withdraw: '0', - netProfit: '0', - }, - totalNetProfit: '0', - passiveMoney: '0', - passiveComp: '0', - casino: { - betting: '382,000', - bettingTie: '33,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - slot: { - betting: '382,000', - bettingCancel: '0', - bettingValid: '351,000', - bettingWin: '357,050', - winLoss: '26,950', - commission: { - total: '7,020', - partner: '5,265', - me: '1,755', - }, - betWinSettle: '19,930', - }, - powerball: { - betting: '0', - bettingCancel: '0', - bettingValid: '0', - bettingWin: '0', - winLoss: '0', - commission: { - total: '0', - partner: '0', - me: '0', - }, - betWinSettle: '19,930', - }, - }, - totalBetSettle: '119,400', + id: '8fcce528-d878-4cc8-99f7-bd3451ed5402', + signinId: 'aa100', + rank: '회원', + level: '4', + nickname: 'aa100', + memberCharge: 40100000, + memberExchange: 19000000, + memberProfitLoss: 21100000, + partnerCharge: 0, + partnerExchange: 0, + partnerProfitLoss: 0, + totalProfitLoss: 21100000, + passiveMoney: -20002000, + passiveComp: 0, + casinoBetting: 13648000, + casinoTie: 314000, + casinoCancel: 0, + casinoAvailable: 13334000, + casinoWinning: 12649500, + casinoWinLoss: 998500, + casinoCommission: 83347, + casinoBetWinCalculate: 915153, + slotBetting: 1159511, + slotCancel: 0, + slotAvailable: 1159511, + slotWinning: 897768, + slotWinLoss: 261743, + slotCommission: 6800, + slotBetWinCalculate: 254943, + powerballBetting: 0, + powerballWinning: 0, + powerballWinLoss: 0, + powerballCommission: 0, + powerballBetWinCalculate: 0, + totalBetWinCalculate: 0, }, ]; diff --git a/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts b/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts index 166837d..1af2647 100644 --- a/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts +++ b/src/app/modules/admin/report/daily-partner/services/daily-partner.service.ts @@ -88,7 +88,7 @@ export class DailyPartnerService { .get<{ pagination: DailyPartnerPagination; dailyPartners: DailyPartner[]; - }>('api/apps/report/daily-partner/daily-partners', { + }>('api/apps/report/daily-partners', { params: { page: '' + page, size: '' + size, diff --git a/src/app/modules/admin/report/monthly/components/list.component.html b/src/app/modules/admin/report/monthly/components/list.component.html index 17a7572..29bb75c 100644 --- a/src/app/modules/admin/report/monthly/components/list.component.html +++ b/src/app/modules/admin/report/monthly/components/list.component.html @@ -7,9 +7,7 @@ class="sm:col-span-6 flex flex-col flex-auto p-6 bg-card shadow rounded-2xl overflow-hidden" > -
- CASINO 머니파악 -
+
월현황
+
+
+ +
+ +
+ + + + 전체 + 파워볼 + 카지노 + 슬롯 + + + + + 회원아이디 + 닉네임 + + + +
+ -
- 금일배팅자목록 -
-
- - -
- -
- - - - {{ - roleSelect.value | titlecase - }} - - - -
{{ role.label }}
-
-
-
-
-
- -
- - - - - -
- -
- - - - - -
- -
- - - - {{ - roleSelect.value | titlecase - }} - - - -
{{ role.label }}
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
등급 - - {{ info?.user.rank }} - - 레벨 - - {{ info?.user.level }} - - 아이디 - - {{ info?.user.signinId }} - - 닉네임 - - {{ info?.user.nickname }} - - 회원입출 - {{ info?.bank.users.deposit }} - {{ info?.bank.users.withdraw }} - {{ info?.bank.users.netProfit }} - 파트너입출 - {{ info?.bank.parthners.deposit }} - {{ info?.bank.parthners.withdraw }} - {{ info?.bank.parthners.netProfit }} - 총손익 - {{ info?.bank.totalNetProfit }} - 수동머니 - {{ info?.bank.passiveMoney }} - 수동콤프 - {{ info?.bank.passiveComp }} - 배팅 - {{ info?.bank.casino.betting }} - 당첨 - {{ info?.bank.casino.bettingWin }} - 윈로스(A) - {{ info?.bank.casino.winLoss }} - 수수료(B) - {{ info?.bank.casino.commission.total }} - 벳윈정산(A-B) - {{ info?.bank.casino.betWinSettle }} - 배팅 - {{ info?.bank.slot.betting }} - 당첨 - {{ info?.bank.slot.bettingWin }} - 윈로스(D) - {{ info?.bank.slot.winLoss }} - 수수료(E) - {{ info?.bank.slot.commission.total }} - 벳윈정산(A-B) - {{ info?.bank.slot.commission.betWinSettle }} - 배팅 - {{ info?.bank.powerball.betting }} - 당첨 - {{ info?.bank.powerball.bettingWin }} - 윈로스(G) - {{ info?.bank.powerball.winLoss }} - 수수료(H) - {{ info?.bank.powerball.commission.total }} - 벳윈정산(G-H) - {{ info?.bank.powerball.commission.betWinSettle }} - 총벳윈정산 - {{ info?.totalBetSettle }} - - Second group -
-
-
-
+ + + + +
+ +
+ + + + + +
+ + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + +
+ +
+ + +
+ +
+
+ 아이디 +
+ 닉네임 +
+
+ 등급 +
+ 레벨 +
+
회원입출금
+
파트너입출금
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ {{ todayBet.signinId }} +
+ {{ todayBet.nickname }} +
+
+ {{ todayBet.rank }} +
+ {{ todayBet.level }} +
+
+ 충전{{ todayBet.memberCharge }} +
+ 환전{{ todayBet.memberExchange }} +
+ 손익{{ todayBet.memberProfitLoss }} +
+
+ 충전{{ todayBet.partnerCharge }} +
+ 환전{{ todayBet.partnerExchange }} +
+ 손익{{ todayBet.partnerProfitLoss }} +
+ + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+ + +
+ There are no data! +
+
+
+
diff --git a/src/app/modules/admin/report/today-bet/components/list.component.ts b/src/app/modules/admin/report/today-bet/components/list.component.ts index 542cfb4..440eff0 100644 --- a/src/app/modules/admin/report/today-bet/components/list.component.ts +++ b/src/app/modules/admin/report/today-bet/components/list.component.ts @@ -34,7 +34,6 @@ import { TodayBet } from '../models/today-bet'; import { TodayBetPagination } from '../models/today-bet-pagination'; import { TodayBetService } from '../services/today-bet.service'; import { Router } from '@angular/router'; -import { MatTableDataSource } from '@angular/material/table'; @Component({ selector: 'today-bet-list', @@ -43,18 +42,22 @@ import { MatTableDataSource } from '@angular/material/table'; /* language=SCSS */ ` .inventory-grid { - grid-template-columns: 60px auto 40px; + /* 아이디 등급 회원 */ + grid-template-columns: 40px auto 30px; @screen sm { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; + /* 아이디 등급 회원 파트너 손익 머니 콤프 카배팅 */ + grid-template-columns: 40px auto 30px 30px 30px 30px 30px 30px; } @screen md { - grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; + /* 아이디 등급 회원 파트너 손익 머니 콤프 카배팅 카당첨 */ + grid-template-columns: 40px auto 30px 30px 30px 30px 30px 30px 30px; } @screen lg { - grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; + /* 아이디 등급 회원 파트너 손익 머니 콤프 카배팅 카당첨 카윈로스 카수수료 카정산 슬배팅 슬당첨 슬윈로스 슬수수료 슬정산 파배팅 파당첨 파윈로스 파수수료 파정산 총정산 */ + grid-template-columns: 40px auto 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px; } } `, @@ -64,48 +67,20 @@ import { MatTableDataSource } from '@angular/material/table'; animations: fuseAnimations, }) export class ListComponent implements OnInit, AfterViewInit, OnDestroy { + @ViewChild(MatPaginator) private _paginator!: MatPaginator; + @ViewChild(MatSort) private _sort!: MatSort; + todayBets$!: Observable; users$!: Observable; + __isSearchOpened = false; isLoading = false; searchInputControl = new FormControl(); selectedTodayBet?: TodayBet; + pagination?: TodayBetPagination; - todayBetForm!: FormGroup; - - todayBetDataSource: MatTableDataSource = new MatTableDataSource(); - todayBetTableColumns: string[] = [ - 'rank', - 'level', - 'signinId', - 'nickname', - 'depositDetails', - 'depositPartnerDetails', - 'totalProfit', - 'passiveMoney', - 'passiveComp', - 'casinoBetDetails', - 'casinoWinningDetails', - 'casinoWinLoss', - 'casinoCommission', - 'casinoSettle', - 'slotBetDetails', - 'slotWinningDetails', - 'slotWinLoss', - 'slotCommission', - 'slotSettle', - 'powerballBetDetails', - 'powerballWinningDetails', - 'powerballWinLoss', - 'powerballCommission', - 'powerballSettle', - 'totalBetWinSettle', - ]; private _unsubscribeAll: Subject = new Subject(); - roles1: any[]; - roles2: any[]; - /** * Constructor */ @@ -115,36 +90,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { private _formBuilder: FormBuilder, private _todayBetService: TodayBetService, private router: Router - ) { - this.roles1 = [ - { - label: '전체', - value: '전체', - }, - { - label: '파워볼', - value: '파워볼', - }, - { - label: '카지노', - value: '카지노', - }, - { - label: '슬롯', - value: '슬롯', - }, - ]; - this.roles2 = [ - { - label: '회원아이디', - value: '회원아이디', - }, - { - label: '닉네임', - value: '닉네임', - }, - ]; - } + ) {} // ----------------------------------------------------------------------------------------------------- // @ Lifecycle hooks @@ -154,19 +100,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { * On init */ ngOnInit(): void { - this.todayBetForm = this._formBuilder.group({ - bankName: [''], - accountNumber: [''], - accountHolder: [''], - }); // Get the pagination - this._todayBetService - .getTodayBets() + this._todayBetService.pagination$ .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((todayBets: any) => { + .subscribe((pagination: TodayBetPagination | undefined) => { + // Update the pagination + this.pagination = pagination; + // Mark for check - this.todayBetDataSource = todayBets.todayBets; - console.log(todayBets); this._changeDetectorRef.markForCheck(); }); @@ -177,7 +118,45 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { /** * After view init */ - ngAfterViewInit(): void {} + ngAfterViewInit(): void { + if (this._sort && this._paginator) { + // Set the initial sort + this._sort.sort({ + id: 'signinId', + start: 'asc', + disableClear: true, + }); + + // Mark for check + this._changeDetectorRef.markForCheck(); + + // If the todayBet changes the sort order... + this._sort.sortChange + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe(() => { + // Reset back to the first page + this._paginator.pageIndex = 0; + }); + + // Get products if sort or page changes + merge(this._sort.sortChange, this._paginator.page) + .pipe( + switchMap(() => { + this.isLoading = true; + return this._todayBetService.getTodayBets( + this._paginator.pageIndex, + this._paginator.pageSize, + this._sort.active, + this._sort.direction + ); + }), + map(() => { + this.isLoading = false; + }) + ) + .subscribe(); + } + } /** * On destroy @@ -212,6 +191,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { */ __toggleDetails(productId: string): void {} + /** + * toggle the search + * Used in 'bar' + */ + __onClickSearch(): void { + this.__isSearchOpened = !this.__isSearchOpened; + } + /** * Track by function for ngFor loops * @@ -221,7 +208,4 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { __trackByFn(index: number, item: any): any { return item.id || index; } - __testData(info: any): any { - console.log(info); - } } diff --git a/src/app/modules/admin/report/today-bet/models/today-bet.ts b/src/app/modules/admin/report/today-bet/models/today-bet.ts index ff7c9ce..42936c7 100644 --- a/src/app/modules/admin/report/today-bet/models/today-bet.ts +++ b/src/app/modules/admin/report/today-bet/models/today-bet.ts @@ -1,29 +1,39 @@ +import { StringNullableChain } from 'lodash'; + export interface TodayBet { - id?: string; - totalPartnerCount?: number; - totalHoldingMoney?: number; - totalComp?: number; - total?: number; - branchCount?: number; - divisionCount?: number; - officeCount?: number; - storeCount?: number; - memberCount?: number; + id: string; + signinId?: string; + rank?: string; + level?: string; nickname?: string; - accountHolder?: string; - phoneNumber?: string; - calculateType?: string; - ownCash?: number; - ownComp?: number; - ownCoupon?: number; - gameMoney?: number; - todayComp?: number; - totalDeposit?: number; - totalWithdraw?: number; - balance?: number; - registDate?: string; - finalSigninDate?: string; - ip?: string; - state?: string; - note?: string; + memberCharge?: number; // 회원충전 + memberExchange?: number; // 회원환전 + memberProfitLoss?: number; // 회원손익 + partnerCharge?: number; // 파트너충전 + partnerExchange?: number; // 파트너환전 + partnerProfitLoss?: number; // 파트너손익 + totalProfitLoss?: number; // 전체손익 + passiveMoney?: number; + passiveComp?: number; + casinoBetting?: number; // 카지노배팅 + casinoTie?: number; // 카지노타이 + casinoCancel?: number; // 카지노취소 + casinoAvailable?: number; // 카지노유효 + casinoWinning?: number; // 카지노당첨 + casinoWinLoss?: number; // 카지노윈로스(A) + casinoCommission?: number; // 카지노수수료(B) + casinoBetWinCalculate?: number; // 카지노벳윈정산 (A-B) + slotBetting?: number; // 슬롯배팅 + slotCancel?: number; // 슬롯취소 + slotAvailable?: number; // 슬롯유효 + slotWinning?: number; // 슬롯당첨 + slotWinLoss?: number; // 슬롯윈로스(D) + slotCommission?: number; // 슬롯수수료(E) + slotBetWinCalculate?: number; // 슬롯벳윈정산(D-E) + powerballBetting?: number; // 파워볼배팅 + powerballWinning?: number; // 파워볼당첨 + powerballWinLoss?: number; // 파워볼윈로스(H) + powerballCommission?: number; // 파워볼수수료(I) + powerballBetWinCalculate?: number; // 파워볼벳윈정산(H-I) + totalBetWinCalculate?: number; // 총벳윈정산 } diff --git a/src/app/modules/admin/report/today-bet/services/today-bet.service.ts b/src/app/modules/admin/report/today-bet/services/today-bet.service.ts index 513819a..72b6ba6 100644 --- a/src/app/modules/admin/report/today-bet/services/today-bet.service.ts +++ b/src/app/modules/admin/report/today-bet/services/today-bet.service.ts @@ -70,19 +70,32 @@ export class TodayBetService { * @param order * @param search */ - getTodayBets(search: string = ''): Observable<{ + getTodayBets( + page: number = 0, + size: number = 10, + sort: string = 'name', + order: 'asc' | 'desc' | '' = 'asc', + search: string = '' + ): Observable<{ + pagination: TodayBetPagination; todayBets: TodayBet[]; }> { return this._httpClient .get<{ + pagination: TodayBetPagination; todayBets: TodayBet[]; }>('api/apps/report/today-bet/today-bets', { params: { + page: '' + page, + size: '' + size, + sort, + order, search, }, }) .pipe( tap((response) => { + this.__pagination.next(response.pagination); this.__todayBets.next(response.todayBets); }) ); From 7fd616df0cfb94e8c8d1079b3c4c803cd92456b2 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Fri, 29 Jul 2022 02:17:59 +0000 Subject: [PATCH 4/7] =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EB=93=B1=EB=A1=9D,=20?= =?UTF-8?q?=EC=88=98=EC=A0=95,=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mock-api/apps/board/popup/api.ts | 26 +- src/app/mock-api/apps/board/popup/data.ts | 62 +++ .../admin/board/popup/components/index.ts | 3 +- .../popup/components/list.component.html | 18 +- .../board/popup/components/list.component.ts | 18 +- .../popup/components/redit.component.html | 371 ++++++------------ .../board/popup/components/redit.component.ts | 43 +- .../popup/components/view.component.html | 143 +++++++ .../board/popup/components/view.component.ts | 113 ++++++ .../modules/admin/board/popup/models/popup.ts | 1 + .../admin/board/popup/popup.routing.ts | 19 +- 11 files changed, 530 insertions(+), 287 deletions(-) create mode 100644 src/app/modules/admin/board/popup/components/view.component.html create mode 100644 src/app/modules/admin/board/popup/components/view.component.ts diff --git a/src/app/mock-api/apps/board/popup/api.ts b/src/app/mock-api/apps/board/popup/api.ts index 2cdc93a..b9dd8dc 100644 --- a/src/app/mock-api/apps/board/popup/api.ts +++ b/src/app/mock-api/apps/board/popup/api.ts @@ -42,19 +42,19 @@ export class BoardPopupMockApi { let popups: any[] | null = cloneDeep(this._popups); // Sort the popups - if (sort === 'sku' || sort === 'name' || sort === 'active') { - popups.sort((a, b) => { - const fieldA = a[sort].toString().toUpperCase(); - const fieldB = b[sort].toString().toUpperCase(); - return order === 'asc' - ? fieldA.localeCompare(fieldB) - : fieldB.localeCompare(fieldA); - }); - } else { - popups.sort((a, b) => - order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] - ); - } + // if (sort === 'sku' || sort === 'name' || sort === 'active') { + // popups.sort((a, b) => { + // const fieldA = a[sort].toString().toUpperCase(); + // const fieldB = b[sort].toString().toUpperCase(); + // return order === 'asc' + // ? fieldA.localeCompare(fieldB) + // : fieldB.localeCompare(fieldA); + // }); + // } else { + // popups.sort((a, b) => + // order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] + // ); + // } // If search exists... if (search) { diff --git a/src/app/mock-api/apps/board/popup/data.ts b/src/app/mock-api/apps/board/popup/data.ts index 05cfd91..cd154e0 100644 --- a/src/app/mock-api/apps/board/popup/data.ts +++ b/src/app/mock-api/apps/board/popup/data.ts @@ -2,6 +2,7 @@ export const popups = [ { + id: '1', index: 10, title: '악성배팅 제제 안내', widthSize: 500, @@ -10,5 +11,66 @@ export const popups = [ leftMargin: 100, site: 'all', useOrNot: 'N', + content: 'test', + }, + { + id: '2', + index: 10, + title: '악성배팅 제제 안내2', + widthSize: 500, + heightSize: 830, + topMargin: 100, + leftMargin: 100, + site: 'all', + useOrNot: 'N', + content: 'test', + }, + { + id: '3', + index: 10, + title: '악성배팅 제제 안내3', + widthSize: 500, + heightSize: 830, + topMargin: 100, + leftMargin: 100, + site: 'all', + useOrNot: 'N', + content: 'test', + }, + { + id: '4', + index: 10, + title: '악성배팅 제제 안내4', + widthSize: 500, + heightSize: 830, + topMargin: 100, + leftMargin: 100, + site: 'all', + useOrNot: 'N', + content: 'test', + }, + { + id: '5', + index: 10, + title: '악성배팅 제제 안내5', + widthSize: 500, + heightSize: 830, + topMargin: 100, + leftMargin: 100, + site: 'all', + useOrNot: 'N', + content: 'test', + }, + { + id: '6', + index: 10, + title: '악성배팅 제제 안내6', + widthSize: 500, + heightSize: 830, + topMargin: 100, + leftMargin: 100, + site: 'all', + useOrNot: 'N', + content: 'test', }, ]; diff --git a/src/app/modules/admin/board/popup/components/index.ts b/src/app/modules/admin/board/popup/components/index.ts index d187813..dfb4808 100644 --- a/src/app/modules/admin/board/popup/components/index.ts +++ b/src/app/modules/admin/board/popup/components/index.ts @@ -1,4 +1,5 @@ import { ListComponent } from './list.component'; +import { ViewComponent } from './view.component'; import { ReditComponent } from './redit.component'; -export const COMPONENTS = [ListComponent, ReditComponent]; +export const COMPONENTS = [ListComponent, ViewComponent, ReditComponent]; diff --git a/src/app/modules/admin/board/popup/components/list.component.html b/src/app/modules/admin/board/popup/components/list.component.html index d300d76..376bda2 100644 --- a/src/app/modules/admin/board/popup/components/list.component.html +++ b/src/app/modules/admin/board/popup/components/list.component.html @@ -28,7 +28,12 @@ 제목 - + {{ info.title }} @@ -98,7 +103,12 @@ 비고
- +
diff --git a/src/app/modules/admin/board/popup/components/list.component.ts b/src/app/modules/admin/board/popup/components/list.component.ts index 8180d66..7be1a98 100644 --- a/src/app/modules/admin/board/popup/components/list.component.ts +++ b/src/app/modules/admin/board/popup/components/list.component.ts @@ -179,14 +179,24 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { // @ Public methods // ----------------------------------------------------------------------------------------------------- - viewUserDetail(id: string): void { - let url: string = 'member/user/' + id; - this.router.navigateByUrl(url); - } // ----------------------------------------------------------------------------------------------------- // @ Private methods // ----------------------------------------------------------------------------------------------------- + __viewPopupDetail(id: string): void { + let url: string = 'board/popup/view/' + id; + this.router.navigateByUrl(url); + } + + __createPopup(): void { + let url: string = 'board/popup/redit/'; + this.router.navigateByUrl(url); + } + + __modifyPopup(id: string): void { + let url: string = 'board/popup/redit/' + id; + this.router.navigateByUrl(url); + } /** * Create product */ diff --git a/src/app/modules/admin/board/popup/components/redit.component.html b/src/app/modules/admin/board/popup/components/redit.component.html index 844b557..f64a01b 100644 --- a/src/app/modules/admin/board/popup/components/redit.component.html +++ b/src/app/modules/admin/board/popup/components/redit.component.html @@ -1,260 +1,127 @@
- - - -
- - - -
-
- -
-
- -
- -
- - -
-
-
- - -
- -
사이트선택
-
{{ contact.title }}
-
-
- - - -
- -
팝업사이즈
-
- -
-
- - {{ email.label }} -
-
- - 180 -
-
-
-
-
-
- - - -
- -
팝업좌표
-
- -
-
- - {{ - phoneNumber.phoneNumber - }} -
-
- - 180 -
-
-
-
-
-
- - - -
-
팝업제목
-
{{ contact.address }}
-
-
- - - -
팝업내용
-
- - -
-
-
- - -
- -
사용여부
-
- {{ contact.birthday | date: "longDate" }} -
-
-
-
-
-
-
- - - -
-
-
- -
- - 사이트 - - - - {{ category.name }} - - - - -
+ +
+
+ + +
+ + 사이트 + + + + {{ category.name }} + + + + +
- -
- - 팝업 가로 사이즈 - - - - 팝업 세로 사이즈 - - -
- -
- - 팝업 좌표 TOP - - - - 팝업 좌표 LEFT - - -
+ +
+ + 팝업 가로 사이즈 + + + + 팝업 세로 사이즈 + + +
+ +
+ + 팝업 좌표 TOP + + + + 팝업 좌표 LEFT + + +
- -
- - 팝업제목 - - - -
+ +
+ + 팝업제목 + + + +
- -
- - 팝업내용 - - - -
- -
- - 표시여부 - - - - {{ category.name }} - - - - -
- - -
+
+ - - - - - - -
- -
+ 팝업내용 + + + +
+ +
+ + 표시여부 + + + + {{ category.name }} + + + + +
+ + +
+ + + + + + +
+
- +
diff --git a/src/app/modules/admin/board/popup/components/redit.component.ts b/src/app/modules/admin/board/popup/components/redit.component.ts index 25c34cc..cb8f2f3 100644 --- a/src/app/modules/admin/board/popup/components/redit.component.ts +++ b/src/app/modules/admin/board/popup/components/redit.component.ts @@ -8,6 +8,8 @@ import { ViewChild, ViewEncapsulation, } from '@angular/core'; + +import { ActivatedRoute, Router } from '@angular/router'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; @@ -15,7 +17,8 @@ import { Subject, takeUntil } from 'rxjs'; import { fuseAnimations } from '@fuse/animations'; import { FuseConfirmationService } from '@fuse/services/confirmation'; -import { ActivatedRoute, Router } from '@angular/router'; +import { Popup } from '../models/popup'; +import { PopupService } from '../services/popup.service'; @Component({ selector: 'popup-redit', @@ -50,10 +53,11 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy { isLoading = false; searchInputControl = new FormControl(); - contactForm!: FormGroup; + popupForm!: FormGroup; editMode: boolean = false; contact = contacts[0]; categories = categories; + popup: Popup | undefined; private _unsubscribeAll: Subject = new Subject(); @@ -65,7 +69,8 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy { private _fuseConfirmationService: FuseConfirmationService, private _formBuilder: FormBuilder, private _route: ActivatedRoute, - private _router: Router + private _router: Router, + private _popupService: PopupService ) {} // ----------------------------------------------------------------------------------------------------- @@ -77,18 +82,32 @@ export class ReditComponent implements OnInit, AfterViewInit, OnDestroy { */ ngOnInit(): void { // Create the contact form - this.contactForm = this._formBuilder.group({ + this.popupForm = this._formBuilder.group({ id: [''], - name: [''], - emails: this._formBuilder.array([]), - phoneNumbers: this._formBuilder.array([]), + index: [''], title: [''], - company: [''], - birthday: [null], - address: [null], - notes: [null], - tags: [[]], + widthSize: [''], + heightSize: [''], + topMargin: [''], + leftMargin: [''], + site: [''], + useOrNot: [''], + content: [''], }); + + this._popupService.popup$ + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe((popup: Popup | undefined) => { + if (!popup) { + return; + } + + this.popup = popup; + this.popupForm.patchValue(popup); + + // Mark for check + this._changeDetectorRef.markForCheck(); + }); } /** diff --git a/src/app/modules/admin/board/popup/components/view.component.html b/src/app/modules/admin/board/popup/components/view.component.html new file mode 100644 index 0000000..cdfc715 --- /dev/null +++ b/src/app/modules/admin/board/popup/components/view.component.html @@ -0,0 +1,143 @@ +
+ + + +
+ + + +
+
+ +
+
+ +
+ +
+ + +
+
+
+ + +
+ +
사이트선택
+
{{ popup?.site }}
+
+
+ + + +
+ +
팝업사이즈
+
+
+
+ + 가로 +
+
+ + {{ popup?.widthSize }} +
+
+
+
+ + 세로 +
+
+ + {{ popup?.heightSize }} +
+
+
+
+
+ + + +
+ +
팝업좌표
+
+
+
+ + TOP +
+
+ + {{ popup?.topMargin }} +
+
+
+
+ + LEFT +
+
+ + {{ popup?.leftMargin }} +
+
+
+
+
+ + + +
+
팝업제목
+
{{ popup?.title }}
+
+
+ + + +
팝업내용
+
+ + +
+
+
+ + +
+ +
사용여부
+
+ {{ popup?.useOrNot }} +
+
+
+
+
+
+
diff --git a/src/app/modules/admin/board/popup/components/view.component.ts b/src/app/modules/admin/board/popup/components/view.component.ts new file mode 100644 index 0000000..fe3e925 --- /dev/null +++ b/src/app/modules/admin/board/popup/components/view.component.ts @@ -0,0 +1,113 @@ +import { + AfterViewInit, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, + ViewEncapsulation, +} from '@angular/core'; +import { FormBuilder } from '@angular/forms'; +import { Subject, takeUntil } from 'rxjs'; +import { fuseAnimations } from '@fuse/animations'; +import { FuseConfirmationService } from '@fuse/services/confirmation'; + +import { Popup } from '../models/popup'; +import { PopupService } from '../services/popup.service'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'popup-view', + templateUrl: './view.component.html', + styles: [ + /* language=SCSS */ + ` + .inventory-grid { + grid-template-columns: 60px auto 40px; + + @screen sm { + grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; + } + + @screen md { + grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; + } + + @screen lg { + grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; + } + } + `, + ], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, + animations: fuseAnimations, +}) +export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { + isLoading = false; + + private _unsubscribeAll: Subject = new Subject(); + + popup: Popup | undefined; + + /** + * Constructor + */ + constructor( + private _changeDetectorRef: ChangeDetectorRef, + private _fuseConfirmationService: FuseConfirmationService, + private _formBuilder: FormBuilder, + private _popupService: PopupService, + private router: Router + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void { + this._popupService.popup$ + .pipe(takeUntil(this._unsubscribeAll)) + .subscribe((popup: Popup | undefined) => { + if (!popup) { + return; + } + + this.popup = popup; + // Mark for check + this._changeDetectorRef.markForCheck(); + }); + } + + /** + * After view init + */ + ngAfterViewInit(): void {} + + /** + * On destroy + */ + ngOnDestroy(): void { + // Unsubscribe from all subscriptions + this._unsubscribeAll.next(null); + this._unsubscribeAll.complete(); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + // ----------------------------------------------------------------------------------------------------- + // @ Private methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Toggle edit mode + * + * @param editMode + */ + toggleEditMode(): void {} +} diff --git a/src/app/modules/admin/board/popup/models/popup.ts b/src/app/modules/admin/board/popup/models/popup.ts index 7c342ce..9747767 100644 --- a/src/app/modules/admin/board/popup/models/popup.ts +++ b/src/app/modules/admin/board/popup/models/popup.ts @@ -2,6 +2,7 @@ export interface Popup { id?: string; index?: number; title?: string; + content?: string; widthSize?: number; heightSize?: number; topMargin?: number; diff --git a/src/app/modules/admin/board/popup/popup.routing.ts b/src/app/modules/admin/board/popup/popup.routing.ts index 6492012..91e20c9 100644 --- a/src/app/modules/admin/board/popup/popup.routing.ts +++ b/src/app/modules/admin/board/popup/popup.routing.ts @@ -2,9 +2,9 @@ import { Route } from '@angular/router'; import { ListComponent } from './components/list.component'; -import { PopupsResolver } from './resolvers/popup.resolver'; -import { UserResolver } from '../../member/user/resolvers/user.resolver'; +import { PopupsResolver, PopupResolver } from './resolvers/popup.resolver'; import { ReditComponent } from './components/redit.component'; +import { ViewComponent } from './components/view.component'; export const popupRoutes: Route[] = [ { @@ -24,6 +24,21 @@ export const popupRoutes: Route[] = [ path: 'redit', component: ReditComponent, }, + { + path: 'redit/:id', + component: ReditComponent, + resolve: { + popup: PopupResolver, + }, + }, + + { + path: 'view/:id', + component: ViewComponent, + resolve: { + popup: PopupResolver, + }, + }, // { // path: 'redit', From 21188f3ca967dbb2a1fa833d4140acb62abc2ce6 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Fri, 29 Jul 2022 02:35:00 +0000 Subject: [PATCH 5/7] bug fix --- .../modules/admin/board/popup/components/view.component.html | 2 +- .../modules/admin/board/popup/components/view.component.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/modules/admin/board/popup/components/view.component.html b/src/app/modules/admin/board/popup/components/view.component.html index cdfc715..d51a50d 100644 --- a/src/app/modules/admin/board/popup/components/view.component.html +++ b/src/app/modules/admin/board/popup/components/view.component.html @@ -21,7 +21,7 @@
- +
+
+ +
+ +
+ - - +
+ +
+ + + + + +
+ +
+ + + + +
@@ -151,182 +82,100 @@
- - + +
- - - - - - - - +
요율
+ +
- +
- diff --git a/src/app/modules/admin/report/statistics/components/list.component.ts b/src/app/modules/admin/report/statistics/components/list.component.ts index 73af6f2..dac93d0 100644 --- a/src/app/modules/admin/report/statistics/components/list.component.ts +++ b/src/app/modules/admin/report/statistics/components/list.component.ts @@ -69,6 +69,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { statisticss$!: Observable; users$!: Observable; + __isSearchOpened = false; isLoading = false; searchInputControl = new FormControl(); selectedStatistics?: Statistics; @@ -117,7 +118,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { if (this._sort && this._paginator) { // Set the initial sort this._sort.sort({ - id: 'name', + id: 'casinoUse', start: 'asc', disableClear: true, }); @@ -186,6 +187,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { */ __toggleDetails(productId: string): void {} + /** + * toggle the search + * Used in 'bar' + */ + __onClickSearch(): void { + this.__isSearchOpened = !this.__isSearchOpened; + } + /** * Track by function for ngFor loops * diff --git a/src/app/modules/admin/report/statistics/models/statistics.ts b/src/app/modules/admin/report/statistics/models/statistics.ts index a3219a9..1d95e1e 100644 --- a/src/app/modules/admin/report/statistics/models/statistics.ts +++ b/src/app/modules/admin/report/statistics/models/statistics.ts @@ -1,29 +1,32 @@ export interface Statistics { - id?: string; - totalPartnerCount?: number; - totalHoldingMoney?: number; - totalComp?: number; - total?: number; - branchCount?: number; - divisionCount?: number; - officeCount?: number; - storeCount?: number; - memberCount?: number; - nickname?: string; - accountHolder?: string; - phoneNumber?: string; - calculateType?: string; - ownCash?: number; - ownComp?: number; - ownCoupon?: number; - gameMoney?: number; - todayComp?: number; - totalDeposit?: number; - totalWithdraw?: number; - balance?: number; - registDate?: string; - finalSigninDate?: string; - ip?: string; - state?: string; - note?: string; + id: string; + casinoUse?: number; + slotUse?: number; + powerballUse?: number; + casinoBetting?: number; // 카지노배팅 + casinoCancel?: number; // 카지노취소 + casinoAvailable?: number; // 카지노유효 + casinoWinning?: number; // 카지노당첨 + casinoWinLoss?: number; // 카지노윈로스(A) + casinoCommission?: number; // 카지노수수료(B) + casinoBetWinCalculate?: number; // 카지노벳윈정산 (A-B) + slotBetting?: number; // 슬롯배팅 + slotCancel?: number; // 슬롯취소 + slotAvailable?: number; // 슬롯유효 + slotWinning?: number; // 슬롯당첨 + slotWinLoss?: number; // 슬롯윈로스(D) + slotTotalCommission?: number; // 슬롯전체수수료(E) + slotBetWinCalculate?: number; // 슬롯벳윈정산(D-E) + powerballBetting?: number; // 파워볼배팅 + powerballWinning?: number; // 파워볼당첨 + powerballWinLoss?: number; // 파워볼윈로스(H) + powerballCommission?: number; // 파워볼수수료(I) + powerballBetWinCalculate?: number; // 파워볼벳윈정산(H-I) + totalUse?: number; // 총이용회원 + totalAvailable?: number; // 총유효배팅 + totalBetting?: number; // 총배팅 + totalCancel?: number; // 총취소 + totalWinLoss?: number; // 총윈로스 + totalCommission?: number; // 총수수료 + totalBetWinCalculate?: number; // 총벳윈정산 } diff --git a/src/app/modules/admin/report/statistics/statistics.module.ts b/src/app/modules/admin/report/statistics/statistics.module.ts index 737a47c..8222b33 100644 --- a/src/app/modules/admin/report/statistics/statistics.module.ts +++ b/src/app/modules/admin/report/statistics/statistics.module.ts @@ -12,9 +12,7 @@ import { MatSortModule } from '@angular/material/sort'; import { MatSelectModule } from '@angular/material/select'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatGridListModule } from '@angular/material/grid-list'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDatepickerModule } from '@angular/material/datepicker'; import { TranslocoModule } from '@ngneat/transloco'; @@ -42,9 +40,7 @@ import { statisticsRoutes } from './statistics.routing'; MatSelectModule, MatTooltipModule, MatGridListModule, - MatSlideToggleModule, - MatRadioModule, - MatCheckboxModule, + MatDatepickerModule, ], }) export class StatisticsModule {} From 6b726333dd7ecc07c3c69201b601650043ba967d Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Mon, 1 Aug 2022 05:20:25 +0000 Subject: [PATCH 7/7] =?UTF-8?q?=EC=A2=85=EB=AA=A9=EB=B3=84=EB=A7=A4?= =?UTF-8?q?=EC=B6=9C=ED=86=B5=EA=B3=84=20api=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mock-api/apps/report/statistics/api.ts | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/app/mock-api/apps/report/statistics/api.ts b/src/app/mock-api/apps/report/statistics/api.ts index 8c50544..69b7bee 100644 --- a/src/app/mock-api/apps/report/statistics/api.ts +++ b/src/app/mock-api/apps/report/statistics/api.ts @@ -1,13 +1,13 @@ import { Injectable } from '@angular/core'; import { assign, cloneDeep } from 'lodash-es'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; -import { statistics as statisticsData } from './data'; +import { statisticss as statisticssData } from './data'; @Injectable({ providedIn: 'root', }) export class ReportStatisticsMockApi { - private _statistics: any[] = statisticsData; + private _statisticss: any[] = statisticssData; /** * Constructor @@ -26,10 +26,10 @@ export class ReportStatisticsMockApi { */ registerHandlers(): void { // ----------------------------------------------------------------------------------------------------- - // @ Statistics - GET + // @ Statisticss - GET // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onGet('api/apps/report/statistics/statistics', 300) + .onGet('api/apps/report/statistics/statisticss', 300) .reply(({ request }) => { // Get available queries const search = request.params.get('search'); @@ -38,12 +38,12 @@ export class ReportStatisticsMockApi { const page = parseInt(request.params.get('page') ?? '1', 10); const size = parseInt(request.params.get('size') ?? '10', 10); - // Clone the statistics - let statistics: any[] | null = cloneDeep(this._statistics); + // Clone the statisticss + let statisticss: any[] | null = cloneDeep(this._statisticss); - // Sort the statistics + // Sort the statisticss if (sort === 'sku' || sort === 'name' || sort === 'active') { - statistics.sort((a, b) => { + statisticss.sort((a, b) => { const fieldA = a[sort].toString().toUpperCase(); const fieldB = b[sort].toString().toUpperCase(); return order === 'asc' @@ -51,15 +51,15 @@ export class ReportStatisticsMockApi { : fieldB.localeCompare(fieldA); }); } else { - statistics.sort((a, b) => + statisticss.sort((a, b) => order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] ); } // If search exists... if (search) { - // Filter the statistics - statistics = statistics.filter( + // Filter the statisticss + statisticss = statisticss.filter( (contact: any) => contact.name && contact.name.toLowerCase().includes(search.toLowerCase()) @@ -67,32 +67,32 @@ export class ReportStatisticsMockApi { } // Paginate - Start - const statisticsLength = statistics.length; + const statisticssLength = statisticss.length; // Calculate pagination details const begin = page * size; - const end = Math.min(size * (page + 1), statisticsLength); - const lastPage = Math.max(Math.ceil(statisticsLength / size), 1); + const end = Math.min(size * (page + 1), statisticssLength); + const lastPage = Math.max(Math.ceil(statisticssLength / size), 1); // Prepare the pagination object let pagination = {}; // If the requested page number is bigger than // the last possible page number, return null for - // statistics but also send the last possible page so + // statisticss but also send the last possible page so // the app can navigate to there if (page > lastPage) { - statistics = null; + statisticss = null; pagination = { lastPage, }; } else { // Paginate the results by size - statistics = statistics.slice(begin, end); + statisticss = statisticss.slice(begin, end); // Prepare the pagination mock-api pagination = { - length: statisticsLength, + length: statisticssLength, size: size, page: page, lastPage: lastPage, @@ -105,7 +105,7 @@ export class ReportStatisticsMockApi { return [ 200, { - statistics, + statisticss, pagination, }, ]; @@ -120,11 +120,11 @@ export class ReportStatisticsMockApi { // Get the id from the params const id = request.params.get('id'); - // Clone the statistics - const statistics = cloneDeep(this._statistics); + // Clone the statisticss + const statisticss = cloneDeep(this._statisticss); // Find the statistics - const statistic = statistics.find((item: any) => item.id === id); + const statistics = statisticss.find((item: any) => item.id === id); // Return the response return [200, statistics]; @@ -160,7 +160,7 @@ export class ReportStatisticsMockApi { }; // Unshift the new statistics - this._statistics.unshift(newStatistics); + this._statisticss.unshift(newStatistics); // Return the response return [200, newStatistics]; @@ -180,13 +180,13 @@ export class ReportStatisticsMockApi { let updatedStatistics = null; // Find the statistics and update it - this._statistics.forEach((item, index, statistics) => { + this._statisticss.forEach((item, index, statisticss) => { if (item.id === id) { // Update the statistics - statistics[index] = assign({}, statistics[index], statistics); + statisticss[index] = assign({}, statisticss[index], statistics); // Store the updated Statistics - updatedStatistics = statistics[index]; + updatedStatistics = statisticss[index]; } }); @@ -204,9 +204,9 @@ export class ReportStatisticsMockApi { const id = request.params.get('id'); // Find the statistics and delete it - this._statistics.forEach((item, index) => { + this._statisticss.forEach((item, index) => { if (item.id === id) { - this._statistics.splice(index, 1); + this._statisticss.splice(index, 1); } });